﻿
using BilbilBLL;
using Common;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Modles.DTO;
using Modles.Models;

namespace bilbil.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class ManageCarouselController : ControllerBase
    {
        [HttpGet]
        public IActionResult GetImage()
        {
            return new JsonResult(new ManageCarouselService().GetImages());
        }
        /// <summary>
        /// 添加轮播图
        /// </summary>
        /// <param name="ImageId"></param>
        /// <returns></returns>
        [HttpPost]
        public IActionResult AddCarousel( int ImageId)
        {
            return new JsonResult(new ManageCarouselService().AddCarousel(ImageId));
        }
        /// <summary>
        /// 删除轮播图
        /// </summary>
        /// <param name="Id"></param>
        /// <returns></returns>
        [HttpDelete]
        public IActionResult DeleteCarousel(int Id)
        {
            return new JsonResult(new ManageCarouselService().DeleteCarousel(Id));
        }
        /// <summary>
        /// 添加轮播图2
        /// </summary>
        /// <param name="ImageId"></param>
        /// <returns></returns>
        [HttpPost]
        public IActionResult AddCarouselTwo(int ImageId)
        {
            return new JsonResult(new ManageCarouselService().AddCarouselTwo(ImageId));
        }
        /// <summary>
        /// 删除轮播图2
        /// </summary>
        /// <param name="Id"></param>
        /// <returns></returns>
        [HttpDelete]
        public IActionResult DeleteCarouselTwo(int Id)
        {
            return new JsonResult(new ManageCarouselService().DeleteCarouselTwo(Id));
        }

        
    }
}
